<!--Generate by Kevin's CodeBuilder -->
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
		<meta charset="UTF-8">
		<title>bui-ssm快速开发框架</title>
		<head th:include="source::header"></head>
</head>
<body>
		<div class="form_main_wrap" style="height:100%;">			
			<div class="form_grid" style="height:100%;">
				<table id="datagrid"></table>
			</div>
		</div>
</div>
<script type="application/javascript" th:inline="javascript">
		var curdObj,
			height = 450,
			gridOpts = [(${dataGridJson})];//获取datagrid配置json
			var title = "[(${Lang.menu_windowTitle})]";//国际化语言
			gridOpts.title = title;
		$(function () {
			var dg = $("#datagrid");
			gridOpts.setParams = function(){
				return {pid:0};
			};
			gridOpts.fillParent = true;
			gridOpts.pgposition = "both";
			gridOpts.sortField = {"orderIndex" : "asc"};
			gridOpts.oprColWidth = 230;
			curdObj = new $B.CURD(dg, gridOpts);
		});
		//打开form.html
		function _openForm(prs,isUpdate,rowData){
			var opts = {
				dataType:'html',
				title:title,
				width:700,
				height:height,
				params:{
					pid : 0
				}
			};
			if(isUpdate && rowData){
				opts.rowData = rowData;
			}
			curdObj.window(opts,isUpdate);
		};
		/******工具栏事件集合******/
		window.toolMethods = {
			addFn:function(prs){
				_openForm(prs);
			},
			updateFn:function(prs){
				_openForm(prs,true);
			},
			deleteFn:function(prs){
				curdObj.delChecked();
			},
			lineUpdateFn:function(prs){
				_openForm(prs,true,prs);
			},
			lineDeleteFn:function(prs){
				curdObj.deleteData([prs.id]);
			},
			treeFn:function(prs){
				var opts = {
					dataType:'iframe',
					title:title+"["+prs.menuText+"]",
					full:true,
					content: $B.getHttpHost(ctxPath) + "menu/page/tree?pid="+prs.id
				};					
				$B.window(opts);
			}
		};
		/***格式化***/
		function formatLeaf(cellData,rowData){
			if(cellData === 1){
				return "[(${Lang.common_yes})]";
			}
			return "[(${Lang.common_no})]";
		}  
		function formatEnable(cellData,rowData){
			if(cellData === 1){
				return "[(${Lang.common_yes})]";
			}
			return "[(${Lang.common_no})]";
		}  
		function formatVisible(cellData,rowData){
			if(cellData === 1){
				return "[(${Lang.common_yes})]";
			}
			return "[(${Lang.common_no})]";
		}
</script>
</body>
</html>
